package com.ccrfid.rmc6.entity.business.nightpatrol;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.vividsolutions.jts.geom.Point;
import com.vividsolutions.jts.geom.Polygon;
import org.hibernate.annotations.Type;

import javax.persistence.*;
import java.sql.Date;

@Entity
@Table(name = "np_group")
public class NpGroupEntity {
    private Long id;
    private String groupName;
    private String startPatrolPlace;
    private Long startPatrolPlaceId;
    private String endPatrolPlace;
    private Long endPatrolPlaceId;
    private Date startTime;
    private Date endTime;
    private String startTimePoint;
    private String endTimePoint;
    private int timeLength;
    private Point startLocationCentroid;
    private Polygon startLocationPolygon;
    private Point endLocationCentroid;
    private Polygon endLocationPolygon;


    @Id
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "group_name", nullable = false, length = 45)
    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    @Basic
    @Column(name = "start_patrol_place", nullable = false, length = 255)
    public String getStartPatrolPlace() {
        return startPatrolPlace;
    }

    public void setStartPatrolPlace(String startPatrolPlace) {
        this.startPatrolPlace = startPatrolPlace;
    }

    @Basic
    @Column(name = "start_patrol_place_id")
    public Long getStartPatrolPlaceId() {
        return startPatrolPlaceId;
    }

    public void setStartPatrolPlaceId(Long startPatrolPlaceId) {
        this.startPatrolPlaceId = startPatrolPlaceId;
    }


    @Basic
    @Column(name = "end_patrol_place", nullable = false, length = 255)
    public String getEndPatrolPlace() {
        return endPatrolPlace;
    }

    public void setEndPatrolPlace(String endPatrolPlace) {
        this.endPatrolPlace = endPatrolPlace;
    }

    @Basic
    @Column(name = "end_patrol_place_id")
    public Long getEndPatrolPlaceId() {
        return endPatrolPlaceId;
    }

    public void setEndPatrolPlaceId(Long endPatrolPlaceId) {
        this.endPatrolPlaceId = endPatrolPlaceId;
    }


    @Basic
    @Column(name = "start_time", nullable = false)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }


    @Basic
    @Column(name = "end_time", nullable = false)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    @Basic
    @Column(name = "start_time_point", nullable = false, length = 20)
    public String getStartTimePoint() {
        return startTimePoint;
    }

    public void setStartTimePoint(String startTimePoint) {
        this.startTimePoint = startTimePoint;
    }

    @Basic
    @Column(name = "end_time_point", nullable = false, length = 20)
    public String getEndTimePoint() {
        return endTimePoint;
    }

    public void setEndTimePoint(String endTimePoint) {
        this.endTimePoint = endTimePoint;
    }

    @Basic
    @Column(name = "time_length")
    public Integer getTimeLength() {
        return timeLength;
    }

    public void setTimeLength(Integer timeLength) {
        this.timeLength = timeLength;
    }
//
//    @Basic
//    @Column(name = "time_interval")
//    public Integer getTimeInterval() {
//        return timeInterval;
//    }
//
//    public void setTimeInterval(Integer timeInterval) {
//        this.timeInterval = timeInterval;
//    }

    @Basic
    @Column(name = "start_location_centroid", nullable = false)
    @Type(type = "jts_geometry")
    public Point getStartLocationCentroid() {
        return startLocationCentroid;
    }

    public void setStartLocationCentroid(Point startLocationCentroid) {
        this.startLocationCentroid = startLocationCentroid;
    }

    @Basic
    @Column(name = "start_location_polygon", nullable = false)
    @Type(type = "jts_geometry")
    public Polygon getStartLocationPolygon() {
        return startLocationPolygon;
    }

    public void setStartLocationPolygon(Polygon startLocationPolygon) {
        this.startLocationPolygon = startLocationPolygon;
    }

    @Basic
    @Column(name = "end_location_centroid", nullable = false)
    @Type(type = "jts_geometry")
    public Point getEndLocationCentroid() {
        return endLocationCentroid;
    }

    public void setEndLocationCentroid(Point endLocationCentroid) {
        this.endLocationCentroid = endLocationCentroid;
    }

    @Basic
    @Column(name = "end_location_polygon", nullable = false)
    @Type(type = "jts_geometry")
    public Polygon getEndLocationPolygon() {
        return endLocationPolygon;
    }

    public void setEndLocationPolygon(Polygon endLocationPolygon) {
        this.endLocationPolygon = endLocationPolygon;
    }

}
